import {
	uploadUrl
} from '@/pages/api/report/helperOrderp.js'
import {
	getByOrdersId,
	updatechutu
} from '@/pages/api/report/orderp.js'
import {
	getOrderDetail,
	getWorkOrderLogs,
	getTakeTask,
	postOrderHandle,
	orgByNodeId,
	allocate,
	allocatedo,
	getPdf,
	detailById,
	postWithdraw,
	postOrderAudit,
	getTransferDepartment,
	getNextPersons,
	postOrderDispatch,
	postCheck,
	getMyList,
	allocatepostWithdraw,
	allocatepostCloseOrder,
	postCloseOrder
} from '@/pages/api/orderp/orderp.js'
import {
	addwgxnd,
	addwgczxx,
	addwgaj,
	addBeUnearthedField
} from '@/pages/api/report/orderp.js'
// import { getaddEvent } from '@/api/wisdomEmergency/wisdom.js'
// import { getUrbanType } from '@/api/orderp/cityManagement/api.js'
import {
	mapState,
	mapMutations
} from 'vuex'
export default {
	computed: {
		...mapState(['userInfo']),
		inputed() {
			if (this.checkop == 1) {
				return false
			} else {
				return true
			}
		}
	},
	methods: {
		...mapMutations('mdOrder', ['setOrderIdSp', 'setInfoOrder', 'setInfoRecords']),
		...mapMutations('mdApprove', ['setInfoApprove', 'setLicenseData']),
		//转发
		forward() {
			this.personShow = true
		},
		// 工单转发成功
		appointTaskSuccess() {
			uni.$emit('updatelist', 10)
			this.$refs.uToast.show({
				title: '转发成功',
				type: 'success',
				url: '/pages/index/approval/index'
			}, 500)
		},
		appointTaskCancel() {
			this.personShow = false
		},
		changesw(e) {
			console.log(e)
			this.tabCurrent = e.detail.current
		},
		//取消认领
		canceltake() {
			uni.showModal({
				title: '提示',
				content: '是否确定取消认领？',
				confirmText: '确定',
				cancelText: '取消',
				success: res => {
					if (res.confirm) {
						cancelTask({
							id: this.id
						}).then(res => {
							this.orderType = 0
						}).catch(res => {
							uni.$emit('updatelist', 10)
							this.$refs.uToast.show({
								title: res.data.msg,
								type: 'warning',
								url: '/pages/index/approval/index'
							}, 300)
						})
					}
				}
			})
		},
		//分派关闭工单
		allocateout() {
			if (this.outorder != 0) {
				uni.showModal({
					title: '提示',
					content: '是否确定提交？',
					confirmText: '确定',
					cancelText: '取消',
					success: res => {
						if (res.confirm) {
							if (this.outorder == 1) {
								allocatepostCloseOrder({
									id: this.id,
									other: {
										result: "关闭",
										content: this.type_value
									}
								}).then(d => {
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: '关闭成功',
										type: 'success',
										url: '/pages/index/approval/index'
									}, 500)
								}).catch(res => {
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: res.data.msg,
										type: 'warning',
										url: '/pages/index/approval/index'
									}, 300)
								})
							} else if (this.outorder == 2) {
								allocatepostWithdraw({
									id: this.id,
									other: {
										result: "退单整改",
										content: this.type_value
									}
								}).then(res => {
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: '退单成功',
										type: 'success',
										url: '/pages/index/approval/index'
									}, 500)
									// uni.navigateBack()
								}).catch(res => {
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: res.data.msg,
										type: 'warning',
										url: '/pages/index/approval/index'
									}, 300)
								})
							} else {
								postBackStep({
									id: this.id,
									other: {
										result: "返回上一节点",
										content: this.type_value
									}
								}).then(res => {
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: '返回上一节点成功',
										type: 'success',
										url: '/pages/index/approval/index'
									}, 500)
								}).catch(res => {
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: res.data.msg,
										type: 'warning',
										url: '/pages/index/approval/index'
									}, 300)
								})
							}

						}
					}
				});
			}
		},
		gotocards(item) {
			console.log(2)
			uni.navigateTo({
				url: '/pages/index/approval/qiye/cardsInfo?idd=' + this.idd,
				success: res => {
					res.eventChannel.emit('getData', item)
				},
			})
		},
		//更新申报表
		updatechutumsg() {
			let params = {
				accessRoadSclerosis: this.form.chukou.join(','),
				flushingEquipment: this.form.chongxi.join(','),
				dustControl: this.form.fangchen.join(','),
				videoSurveillance: this.form.shipin.join(','),
				weighbridge: this.form.dibang.join(','),
				other: this.form.qita.join(','),
				loessEarthQuantity: this.detailmsg.loessEarthQuantity1 + ',' + this.detailmsg.loessEarthQuantity2,
				plantingSoilEarthQuantity: this.detailmsg.plantingSoilEarthQuantity1 + ',' + this.detailmsg
					.plantingSoilEarthQuantity2,
				muckEarthQuantity: this.detailmsg.muckEarthQuantity1 + ',' + this.detailmsg.muckEarthQuantity2,
				slurryEarthQuantity: this.detailmsg.slurryEarthQuantity1 + ',' + this.detailmsg
					.slurryEarthQuantity2,
				wasterEarthQuantity: this.detailmsg.wasterEarthQuantity1 + ',' + this.detailmsg
					.wasterEarthQuantity2,
				otherEarthQuantity: this.detailmsg.otherEarthQuantity1 + ',' + this.detailmsg.otherEarthQuantity2,
				allEarthQuantity1: this.detailmsg.allEarthQuantity1 + ',' + this.detailmsg.allEarthQuantity2,
				endTime: this.time1,
				startTime: this.time,
				id: this.detailmsg.id,
				isPromise: 1
			}
			updatechutu(params).then(res => {
				console.log(res)
				this.$refs.uToast.show({
					title: '提交成功',
					type: 'success'
				}, 300)
			}).catch(e => {
				console.log(e)
			})
		},
		//通过审核跳转
		passin() {
			// console.log(this.checkop, 77777)
			if (this.checkop == 2) {
				// console.log("审核跳转" + this.checkop, 77777)
				uni.navigateTo({
					url: '/pages/index/approval/passin?id=' + this.id + '&nodeId=' + this.nodeId + '&idd=' +
						this.idd
				})
			} else {
				// this.getorgByNodeId()
				uni.showModal({
					title: '提示',
					content: '是否确定提交核验？',
					confirmText: '确定',
					cancelText: '取消',
					success: res => {
						if (res.confirm) {
							postCheck({
								id: this.id,
								other: {
									result: "工单核验",
									content: this.type_value
								}
							}).then(res => {
								this.show = false
								this.buttontype = 10
								this.updatechutumsg()



								console.log(res)
							}).catch(res => {
								uni.$emit('updatelist', 10)
								this.$refs.uToast.show({
									title: res.data.msg,
									type: 'warning',
									url: '/pages/index/approval/index'
								}, 300)
							})
						} else if (res.cancel) {


						}
					}
				});
			}

		},
		// 选中某个单选框时，由radio时触发
		radioChange(e) {
			console.log(e);
		},
		// 选中任一radio时，由radio-group触发
		radioGroupChange(e) {

			// this.value[e] =  this.value[e]

			console.log(this.value);
		},
		//获取分配部门
		getorgByNodeId() {
			orgByNodeId({
				nodeId: this.nodeId
			}).then(res => {
				res.forEach(d => {
					this.list.push({
						nodeId: d.nodeId,
						orgId: d.orgId,
						orgName: d.orgName,
						checked: false,
						disabled: false
					})
				})
				console.log(res, 9999999, this.nodeId)
				this.list.forEach((item,index)=>{
					// 去除括号及内容
					item.orgName = item.orgName.replace(/\（.*?\）/g,'')  
				})
				// 默认选中字段
				this.list.forEach((item, index) => {
					if (this.detailmsg.competentDepartment == item.orgName) {
						item.checked = true
					} else if (this.detailmsg.street == item.orgName) {
						item.checked = true
					}
				})
				this.list.forEach((item, index) => {
					if(item.checked == true) {
						this.activelist.push(item.orgId)
					}
				})
			})
		},
		getolddetail() {
			return new Promise((resolve, reject) => {
				getByOrdersId({
					ordersId: this.idd
				}).then(res => {
					console.log(res, 333)
					this.detailmsg = res
					this.setInfoApprove(res)
					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		getdetail() {
			console.log('ysqy recoredid', this.id)
			return new Promise((resolve, reject) => {
				getOrderDetail({
					id: this.id
				}).then(res => {
					console.log(res)
					this.detailList = res
					this.setInfoOrder(this.detailList)
					if (this.detailList.type == 10) {
						this.orderType = 2
					} else if (this.detailList.type == 11) {
						this.orderType = 3
					} else {
						this.orderType = this.detailList.orderType
					}

					this.timeLeft = parseInt(this.detailList.timeLeft / 60)
					if (this.detailList.timeLeft > 3600) {
						this.timeLeft = parseInt(this.timeLeft / 60) + '时' + this.timeLeft % 60 +
							'分'
					} else {
						this.timeLeft = +this.timeLeft % 60 + '分'
					}

					this.buttontype = this.detailList.type
					this.detailList.formValue.forEach(d => {

						this.formarr.push({
							display_name: d.display_name,
							value: d[d.name]
						})
					})

					// console.log(this.orderType, 88)
					// this.getcircul()

					resolve(res)
				}).catch(err => {
					reject(err)
				})
			})
		},
		//工单流记录
		getcircul() {
			getWorkOrderLogs({
				id: this.idd
			}).then(res => {
				console.log('************************', res)
				this.circulList = res
				this.setInfoRecords(this.circulList)
			})
		},
		// 跳转至表单盖章页面pages/webview/finnish
		orderFinishHandle() {
			this.setInfoApprove(this.detailmsg)
			this.setInfoOrder(this.detailList)
			this.setInfoRecords(this.circulList)
			uni.navigateTo({
				url: `/pages/webview/finnish`
			})
		},
		//预览图片
		previewPic(e) {
			var current = e.target.dataset.src
			this.getphotolist.length = 0
			this.formarr.forEach(d => {
				if (d.display_name == '招标信息') {
					d.value.forEach(p => {
						this.getphotolist.push(p.url)
					})
				}
			})
			uni.previewImage({
				current: current,
				urls: this.getphotolist
			})
		},
		previewPicchuzhi(e) {
			console.log(e, i)
			var current = e.target.dataset.src
			this.chuzhiphotolist.length = 0
			this.chuzhiarr.forEach(d => {
				if (d.type == 'img') {
					d.value.forEach(p => {
						this.chuzhiphotolist.push(p.url)
					})
				}
			})
			uni.previewImage({
				current: current,
				urls: this.chuzhiphotolist
			})
		},
		//确认审核
		comfirm() {
			if (this.outorder != 0) {
				uni.showModal({
					title: '提示',
					content: '是否确定提交审核？',
					confirmText: '确定',
					cancelText: '取消',
					success: res => {
						if (res.confirm) {
							if (this.outorder == 1) {
								postCloseOrder({
									id: this.id,
									other: {
										result: "关闭",
										content: this.type_value
									}
								}).then(d => {
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: '关闭成功',
										type: 'success',
										url: '/pages/index/approval/index'
									}, 500)
								}).catch(res => {
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: res.data.msg,
										type: 'warning',
										url: '/pages/index/approval/index'
									}, 300)
								})
							} else if (this.outorder == 2) {
								postWithdraw({
									id: this.id,
									other: {
										result: "退单整改",
										content: this.type_value
									}
								}).then(res => {
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: '退单成功',
										type: 'success',
										url: '/pages/index/approval/index'
									}, 500)
									// uni.navigateBack()
								}).catch(res => {
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: res.data.msg,
										type: 'warning',
										url: '/pages/index/approval/index'
									}, 300)
								})
							} else {
								postCloseOrder({
									id: this.id,
									other: {
										result: "关闭",
										content: this.type_value
									}
								}).then(d => {
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: '关闭成功',
										type: 'success',
										url: '/pages/index/approval/index'
									}, 500)
								}).catch(res => {
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: res.data.msg,
										type: 'warning',
										url: '/pages/index/approval/index'
									}, 300)
								})
								// postBackStep({
								// 	id: this.id,
								// 	other: {
								// 		result: "返回上一节点",
								// 		content: this.type_value
								// 	}
								// }).then(res => {
								// 	uni.$emit('updatelist', 10)
								// 	this.$refs.uToast.show({
								// 		title: '返回上一节点成功',
								// 		type: 'success',
								// 		url: '/pages/index/approval/index'
								// 	}, 500)
								// })
							}

						}
					}
				});

			} else {
				if (this.buttontype == 2) {
					uni.showModal({
						title: '提示',
						content: '是否确定提交？',
						confirmText: '确定',
						cancelText: '取消',
						success: res => {
							if (res.confirm) {
								postOrderHandle({
									id: this.id,
									other: {
										result: "工单处置",
										content: this.type_value
									}
								}).then(res => {
									this.getdetail()
									this.show = false
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: '审核成功',
										type: 'success',
										url: '/pages/index/approval/index'
									}, 300)
									// uni.navigateBack()
								}).catch(res => {
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: res.data.msg,
										type: 'warning',
										url: '/pages/index/approval/index'
									}, 300)
								})
							}
						}
					});
				} else if (this.buttontype == 3) {
					uni.showModal({
						title: '提示',
						content: '是否确定提交审核？',
						confirmText: '确定',
						cancelText: '取消',
						success: res => {
							if (res.confirm) {
								postOrderAudit({
									id: this.id,
									other: {
										result: "工单审核",
										content: this.type_value
									}
								}).then(res => {
									this.show = false
									uni.$emit('updatelist', 10)
									//重新获取完成任务的recordId
									// setTimeout(() => {
									// 	let params = {
									// 		// isDelay: this.isDelay,
									// 		size: 1000,
									// 		itemId: "402887ae7b62cd4f017b62ef1f4c0170"
									// 	}
									// 	getMyList(params).then(res => {
									// 		res.rows.forEach(d => {
									// 			if (d.id == this.idd) {
									// 				this.id = d.recordId
									// 				this.nodeId = d.nodeId
									// 				this.checkop = -1
									// 			}
									// 		})
									// 		this.getcircul()
									// 		console.log('流转记录',this.circulList)
									// 		this.orderFinishHandle()	
									// 	})
									// }, 100)
									this.$refs.uToast.show({
										title: '审核成功',
										type: 'success',
										url: '/pages/index/approval/index'
									}, 300)
								}).catch(res => {
									uni.$emit('updatelist', 10)
									this.$refs.uToast.show({
										title: res.data.msg,
										type: 'warning',
										url: '/pages/index/approval/index'
									}, 300)
								})
							}
						}
					});

				}
			}


		},
		//任务认领
		taketask() {
			getTakeTask({
				id: this.id
			}).then(res => {
				this.orderType = 1
				console.log(res)
			}).catch(res => {
				console.log(res)
				console.log(res.data.msg)
				uni.$emit('updatelist', 10)
				this.$refs.uToast.show({
					title: res.data.msg,
					type: 'warning',
					url: '/pages/index/approval/index'
				}, 300)
			})
		},
		partselect() {

		},
		// 选中某个复选框时，由checkbox时触发
		checkboxChange(e) {
			console.log(e);
			let index = this.activelist.indexOf(e.name)
			if(index > -1) {
				this.activelist.splice(index,1)
			}else{
				this.activelist.push(e.name)
			}
		},
		// 选中任一checkbox时，由checkbox-group触发
		checkboxGroupChange(e) {
			console.log(e);
		},
		// 全选
		checkedAll() {
			this.list.map(val => {
				val.checked = true;
			})
		},
		//退单
		passout(index) {
			this.show = true
			this.outorder = index
		},
		comfirm_part() {
			uni.showModal({
				title: '提示',
				content: '是否确定提交？',
				confirmText: '确定',
				cancelText: '取消',
				success: res => {
					if (res.confirm) {
						if (this.buttontype == 11) {
							allocatedo({
								"id": this.id,
								"formValue": [{
									"name": "orderName",
									"type": "text",
									"params": {},
									"display_name": "分派处置内容",
									"orderName": this.type_value
								}]
							}).then(d => {
								console.log(d)

								this.show = false
								uni.$emit('updatelist', 10)
								this.$refs.uToast.show({
									title: '提交成功',
									type: 'success',
									url: '/pages/index/approval/index'
								}, 500)
								// uni.navigateBack()
							}).catch(res => {
								uni.$emit('updatelist', 10)
								this.$refs.uToast.show({
									title: res.data.msg,
									type: 'warning',
									url: '/pages/index/approval/index'
								}, 300)
							})
						} else {
							// this.activelist = ['GO_df2f46315d414518a31bea909fbd67a6']
							allocate({
								id: this.id,
								orgIds: this.activelist,
								other: {
									result: "工单分配",
									content: "工单分配"
								}
							}).then(res => {

								this.show = false
								uni.$emit('updatelist', 10)
								// uni.navigateBack()
								this.$refs.uToast.show({
									title: '提交成功',
									type: 'success',
									url: '/pages/index/approval/index'
								}, 300)

								console.log(res)
							}).catch(res => {
								uni.$emit('updatelist', 10)
								this.$refs.uToast.show({
									title: res.data.msg,
									type: 'warning',
									url: '/pages/index/approval/index'
								}, 300)
							})
						}
					}
				}
			});

			console.log(this.activelist)
		},
		getnewpdf() {
			uni.downloadFile({
				url: 'http://172.21.188.5:8085/zzd/zxsb/getPdf?department=县大数据局&opinion=999', //仅为示例，并非真实的资源
				success: (res) => {
					console.log('下载成功', res);
					let filePath = res.tempFilePath
					uni.uploadFile({
						url: uploadUrl,
						filePath,
						name: 'file',
						formData: {
							itemId: 'chengguansuishoupai'
						},
						success: (uploadFileRes) => {
							console.log(uploadFileRes)
						},
						fail: err => {
							console.log(err)
						}
					});
				},
				fail: (e) => {
					console.log('下载失败', e);
				}
			});
		},
		getDate(type) {
			const date = new Date();
			let year = date.getFullYear();
			let month = date.getMonth() + 1;
			let day = date.getDate();

			if (type === 'start') {
				year = year - 60;
			} else if (type === 'end') {
				year = year + 2;
			}
			month = month > 9 ? month : '0' + month;;
			day = day > 9 ? day : '0' + day;
			return `${year}-${month}-${day}`;
		},
		navigationToEvent() {

			uni.navigateTo({
				url: '/pages/drawmap/index'
			})
		},
		//返回上一级
		goBack() {
			uni.navigateBack()
		},
		//获取当前位置
		getLocation() {
			uni.getLocation({
				type: 'wgs84',
				geocode: true,
				success: res => {
					console.log(res, 888)
					this.form.lat = res.latitude
					this.form.lng = res.longitude
					this.getaddress(this.form.lng, this.form.lat)
					// this.form.address = res.latitude + ',' + res.longitude
					// if(res.address){
					// 	this.form.address = res.address.province + res.address.city + res.address.district + res.address.street + res.address.streetNum + res.address.poiName
					// 	// this.addressModalshow = false
					// 	uni.hideLoading();
					// } else {
					// 	console.log(5555)
					// 	this.getLocation()
					// }
				}
			});
		},

		//文件tab点击  0录音 1拍照 2相册  照片限定最多2张
		fileTabChoose(index) {
			let photoCount = 10 - this.photoList.length
			if (index === 0) {
				if (photoCount != 0) {
					uni.chooseImage({
						sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
						sourceType: ['camera'], //从相册选择
						success: res => {
							console.log(res)
							res.tempFiles.forEach(e => {
								this.requestUploadImg(e.path).then(res => {
									if (res) {
										this.photoList.push(res)
									}
								})
							})
						}
					});
				}
			} else if (index === 1) {
				if (photoCount != 0) {
					uni.chooseImage({
						count: photoCount, //默认9
						sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
						sourceType: ['album'], //从相册选择
						success: res => {
							console.log(res)
							res.tempFiles.forEach(e => {
								this.requestUploadImg(e).then(res => {
									if (res) {
										this.photoList.push(res)
									}
								})
							})
						}
					});
				}
			}
		},
		//删除照片
		delPhoto(index) {
			this.photoList.splice(index, 1)
		},
		//上传照片
		requestUploadImg(filePath) {
			console.log(filePath)
			return new Promise((resolve, reject) => {
				uni.uploadFile({
					url: uploadUrl,
					formData: {
						'file': filePath
					},
					success: (uploadFileRes) => {
						console.log(uploadFileRes)
						if (uploadFileRes.statusCode == 200) {
							resolve(JSON.parse(uploadFileRes.data).data)
						} else {
							reject('上传失败')
						}
					},
					fail: err => {
						reject(err)
					}
				});
			})
		},

		//重新定位
		rePostioning() {
			// this.addressModalshow = true
			uni.showLoading({
				title: '正在获取当前位置'
			});
			setTimeout(() => {
				this.getLocation()
			}, 800)
		},
		//上传成功回调
		upsuccess(res, b, c) {
			console.log(res, b, c)
			if (res.code == 200) {
				this.form.chukou.push(res.data.fileUrl)
			}
		},
		upsuccess1(res, b, c) {
			console.log(res, b, c)
			if (res.code == 200) {
				this.form.chongxi.push(res.data.fileUrl)
			}
		},
		upsuccess2(res, b, c) {
			console.log(res)
			if (res.code == 200) {
				this.form.fangchen.push(res.data.fileUrl)
			}
		},
		upsuccess3(res, b, c) {
			if (res.code == 200) {
				this.form.dibang.push(res.data.fileUrl)
			}
		},
		upsuccess4(res, b, c) {
			if (res.code == 200) {
				this.form.shipin.push(res.data.fileUrl)
			}
		},
		upsuccess5(res, b, c) {
			if (res.code == 200) {
				this.form.qita.push(res.data.fileUrl)
			}
		},
		uperr(a, b, c) {
			console.log(a, b, c)
		},
		getaddress(lat, lon) {
			this.test.getRegeo({
				location: lat + ',' + lon, //location的格式为'经度,纬度'
				//成功回调
				success: (data) => {
					console.log(data[0].regeocodeData.formatted_address, data[0].name)
					this.form.address = data[0].regeocodeData.formatted_address
				},
				fail: function(info) {
					//失败回调
					console.log(info)
				}
			})
		},
		inputs(e) {
			let val = 0
			this.detailmsg.muckEarthQuantity1 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity1) + parseInt(this.detailmsg.loessEarthQuantity1) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity1) +
				parseInt(this.detailmsg.slurryEarthQuantity1) + parseInt(this.detailmsg.wasterEarthQuantity1) +
				parseInt(this.detailmsg.otherEarthQuantity1)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity1': val
			})
			console.log(this.detailmsg.muckEarthQuantity1, this.detailmsg.allEarthQuantity1)
		},
		input2021(e) {
			let val = 0
			this.detailmsg.muckEarthQuantity2 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity2) + parseInt(this.detailmsg.loessEarthQuantity2) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity2) +
				parseInt(this.detailmsg.slurryEarthQuantity2) + parseInt(this.detailmsg.wasterEarthQuantity2) +
				parseInt(this.detailmsg.otherEarthQuantity2)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity2': val
			})
			console.log(this.detailmsg.muckEarthQuantity2, this.detailmsg.allEarthQuantity2)
		},
		inputs(e) {
			let val = 0
			this.detailmsg.muckEarthQuantity1 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity1) + parseInt(this.detailmsg.loessEarthQuantity1) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity1) +
				parseInt(this.detailmsg.slurryEarthQuantity1) + parseInt(this.detailmsg.wasterEarthQuantity1) +
				parseInt(this.detailmsg.otherEarthQuantity1)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity1': val
			})
			console.log(this.detailmsg.muckEarthQuantity1, this.detailmsg.allEarthQuantity1)
		},
		input2021(e) {
			let val = 0
			this.detailmsg.muckEarthQuantity2 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity2) + parseInt(this.detailmsg.loessEarthQuantity2) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity2) +
				parseInt(this.detailmsg.slurryEarthQuantity2) + parseInt(this.detailmsg.wasterEarthQuantity2) +
				parseInt(this.detailmsg.otherEarthQuantity2)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity2': val
			})
			console.log(this.detailmsg.muckEarthQuantity2, this.detailmsg.allEarthQuantity2)
		},
		inputs(e) {
			let val = 0
			this.detailmsg.muckEarthQuantity1 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity1) + parseInt(this.detailmsg.loessEarthQuantity1) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity1) +
				parseInt(this.detailmsg.slurryEarthQuantity1) + parseInt(this.detailmsg.wasterEarthQuantity1) +
				parseInt(this.detailmsg.otherEarthQuantity1)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity1': val
			})
			console.log(this.detailmsg.muckEarthQuantity1, this.detailmsg.allEarthQuantity1)
		},
		input_year(e) {
			let val = 0
			this.detailmsg.muckEarthQuantity2 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity2) + parseInt(this.detailmsg.loessEarthQuantity2) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity2) +
				parseInt(this.detailmsg.slurryEarthQuantity2) + parseInt(this.detailmsg.wasterEarthQuantity2) +
				parseInt(this.detailmsg.otherEarthQuantity2)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity2': val
			})
		},
		inputs1(e) {
			let val = 0
			this.detailmsg.loessEarthQuantity1 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity1) + parseInt(this.detailmsg.loessEarthQuantity1) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity1) +
				parseInt(this.detailmsg.slurryEarthQuantity1) + parseInt(this.detailmsg.wasterEarthQuantity1) +
				parseInt(this.detailmsg.otherEarthQuantity1)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity1': val
			})
		},
		input_year1(e) {
			let val = 0
			this.detailmsg.loessEarthQuantity2 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity2) + parseInt(this.detailmsg.loessEarthQuantity2) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity2) +
				parseInt(this.detailmsg.slurryEarthQuantity2) + parseInt(this.detailmsg.wasterEarthQuantity2) +
				parseInt(this.detailmsg.otherEarthQuantity2)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity2': val
			})
			console.log(this.detailmsg.muckEarthQuantity2, this.detailmsg.allEarthQuantity2)
		},
		inputs2(e) {
			let val = 0
			this.detailmsg.plantingSoilEarthQuantity1 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity1) + parseInt(this.detailmsg.loessEarthQuantity1) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity1) +
				parseInt(this.detailmsg.slurryEarthQuantity1) + parseInt(this.detailmsg.wasterEarthQuantity1) +
				parseInt(this.detailmsg.otherEarthQuantity1)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity1': val
			})
		},
		input_year2(e) {
			let val = 0
			this.detailmsg.plantingSoilEarthQuantity2 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity2) + parseInt(this.detailmsg.loessEarthQuantity2) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity2) +
				parseInt(this.detailmsg.slurryEarthQuantity2) + parseInt(this.detailmsg.wasterEarthQuantity2) +
				parseInt(this.detailmsg.otherEarthQuantity2)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity2': val
			})
			console.log(this.detailmsg.muckEarthQuantity2, this.detailmsg.allEarthQuantity2)
		},
		inputs5(e) {
			let val = 0
			this.detailmsg.otherEarthQuantity1 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity1) + parseInt(this.detailmsg.loessEarthQuantity1) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity1) +
				parseInt(this.detailmsg.slurryEarthQuantity1) + parseInt(this.detailmsg.wasterEarthQuantity1) +
				parseInt(this.detailmsg.otherEarthQuantity1)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity1': val
			})
		},
		input_year5(e) {
			let val = 0
			this.detailmsg.otherEarthQuantity2 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity2) + parseInt(this.detailmsg.loessEarthQuantity2) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity2) +
				parseInt(this.detailmsg.slurryEarthQuantity2) + parseInt(this.detailmsg.wasterEarthQuantity2) +
				parseInt(this.detailmsg.otherEarthQuantity2)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity2': val
			})
			console.log(this.detailmsg.muckEarthQuantity2, this.detailmsg.allEarthQuantity2)
		},
		inputs3(e) {
			let val = 0
			this.detailmsg.slurryEarthQuantity1 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity1) + parseInt(this.detailmsg.loessEarthQuantity1) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity1) +
				parseInt(this.detailmsg.slurryEarthQuantity1) + parseInt(this.detailmsg.wasterEarthQuantity1) +
				parseInt(this.detailmsg.otherEarthQuantity1)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity1': val
			})
		},
		input_year3(e) {
			let val = 0
			this.detailmsg.slurryEarthQuantity2 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity2) + parseInt(this.detailmsg.loessEarthQuantity2) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity2) +
				parseInt(this.detailmsg.slurryEarthQuantity2) + parseInt(this.detailmsg.wasterEarthQuantity2) +
				parseInt(this.detailmsg.otherEarthQuantity2)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity2': val
			})
			console.log(this.detailmsg.muckEarthQuantity2, this.detailmsg.allEarthQuantity2)
		},
		inputs4(e) {
			let val = 0
			this.detailmsg.wasterEarthQuantity1 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity1) + parseInt(this.detailmsg.loessEarthQuantity1) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity1) +
				parseInt(this.detailmsg.slurryEarthQuantity1) + parseInt(this.detailmsg.wasterEarthQuantity1) +
				parseInt(this.detailmsg.otherEarthQuantity1)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity1': val
			})
		},
		input_year4(e) {
			let val = 0
			this.detailmsg.wasterEarthQuantity2 = e.detail.value
			val = parseInt(this.detailmsg.muckEarthQuantity2) + parseInt(this.detailmsg.loessEarthQuantity2) + parseInt(
					this.detailmsg.plantingSoilEarthQuantity2) +
				parseInt(this.detailmsg.slurryEarthQuantity2) + parseInt(this.detailmsg.wasterEarthQuantity2) +
				parseInt(this.detailmsg.otherEarthQuantity2)
			this.detailmsg = Object.assign({}, this.detailmsg, {
				'allEarthQuantity2': val
			})
			console.log(this.detailmsg.muckEarthQuantity2, this.detailmsg.allEarthQuantity2)
		},

	}
}
